package com.homestay.service.impl;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.homestay.beans.UserInfoBean;
import com.homestay.dao.IUserInfoDao;
import com.homestay.dao.UserInfoDao;
import com.homestay.service.IUserInfoService;

@Service("userInfoService")
public class UserInfoServiseImpl implements IUserInfoService {
	// 通过类型自动注入
	@Autowired
	private UserInfoDao userInfoDao;

	@Override
	// 查询用户信息
	public  UserInfoBean  showMyInfo(String userID) {
		 UserInfoBean bean=userInfoDao.findAllUserInfo(userID);
		return bean;
	}

	@Override
	// 修改用户信息
	public String upMyInfo(String userId, String nickName, String realName, String cardId, String sex,
			String age, String email, String mobile) {
		//System.out.println(sex);
		String result = "修改失败！";
		
		userInfoDao.upMyInfo(nickName,realName,sex,age,mobile,email,cardId,userId);
		//System.out.println();
		result="修改成功！";
		return result;
	}

}
